Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.observe = function(componentOptions, componentDefinition) {
    var watch = componentOptions.watch, computed = componentOptions.computed;
    if (componentDefinition.behaviors.push(behavior.behavior), watch) {
        var properties = componentDefinition.properties || {};
        Object.keys(watch).forEach(function(propertyName) {
            if (propertyName in properties) {
                var propertyDefinition = properties[propertyName];
                null !== propertyDefinition && "type" in propertyDefinition || (propertyDefinition = {
                    type: propertyDefinition
                }), propertyDefinition.observer = watch[propertyName], properties[propertyName] = propertyDefinition;
            }
        }), componentDefinition.properties = properties;
    }
    computed && (componentDefinition.methods = componentDefinition.methods || {}, componentDefinition.methods.$options = function() {
        return componentOptions;
    }, componentDefinition.properties && (0, props.observeProps)(componentDefinition.properties));
};

var behavior = require("./behavior"), props = require("./props");